CREATE TABLE IF NOT EXISTS `f_relation` (
	`parent_id` INT( 11 ) NULL ,
	`child_id` INT( 11 ) NULL ,
	`relation_type` VARCHAR( 255 ) NULL ,
	`relation_order` INT( 11 ) NULL ,
	`lang` VARCHAR( 5 ) NULL ,
	`parent_model` VARCHAR( 255 ) NULL ,
	`child_model` VARCHAR( 255 ) NULL, 
	`status` VARCHAR( 255 ) NULL,
	 INDEX ( `parent_id` ), INDEX ( `child_id` ), INDEX ( `relation_type` ),
     FOREIGN KEY (`parent_id`) REFERENCES `f_document`(`document_uid`) ON DELETE CASCADE,
	 FOREIGN KEY (`child_id`) REFERENCES `f_document`(`document_uid`) ON DELETE CASCADE
	) ENGINE = InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_general_ci;